{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[u'D_title', u'Title', u'Dsr', u'Commission_queqiao', u'Quan_receive', u'Quan_price', u'Quan_time', u'Jihua_link', u'Price', u'Jihua_shenhe', u'Introduce', u'Cid', u'Sales_num', u'Quan_link', u'IsTmall', u'GoodsID', u'Commission_jihua', u'ID', u'Que_siteid', u'Commission', u'Pic', u'Org_Price', u'Quan_m_link', u'Quan_id', u'Quan_condition', u'Quan_surplus', u'SellerID']\n"
     ]
    }
   ],
   "source": [
    "import requests\n",
    "import json\n",
    "url = \"http://api.dataoke.com/index.php?r=Port/index&type=total&appkey=jm24s426ry&v=2&page=1\"\n",
    "r = requests.get(url)\n",
    "data = json.loads(r.content)\n",
    "# data['data'].keys() # [u'update_time', u'api_type', u'total_num', u'update_content']\n",
    "info = data['data']\n",
    "api_type = info['api_type']\n",
    "total_num = info['total_num']\n",
    "update_content = info['update_content']\n",
    "# print update_content\n",
    "# 内容主体\n",
    "result = data['result']\n",
    "\n",
    "result_1 = result[0]\n",
    "# print result_1.keys()   # [u'D_title', u'Title', u'Dsr', u'Commission_queqiao', \n",
    "                        # u'Quan_receive', u'Quan_price', u'Quan_time', u'Jihua_link', u'Price', \n",
    "                        # u'Jihua_shenhe', u'Introduce', u'Cid', u'Sales_num', u'Quan_link', u'IsTmall', \n",
    "                        # u'GoodsID', u'Commission_jihua', u'ID', u'Que_siteid', u'Commission', \n",
    "                        # u'Pic', u'Org_Price', u'Quan_m_link', u'Quan_id', u'Quan_condition', \n",
    "                        # u'Quan_surplus', u'SellerID']\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
